Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jsbn

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsbn

The jsbn library is a fast, portable implementation of large-number math in pure JavaScript, enabling public-key crypto and other applications on desktop and mobile browsers.

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
33M
decreased by-10.14%
Maintainers
1
Weekly downloads
 
Created

What is jsbn?

The jsbn npm package is a library that implements big number arithmetic and RSA encryption. It is useful for cryptography and other applications that require manipulation of large integers that are beyond the native JavaScript Number limit.

What are jsbn's main functionalities?

Big Number Arithmetic

This feature allows for the addition, subtraction, multiplication, division, and modulus operations on large integers.

var BigInteger = require('jsbn').BigInteger;
var a = new BigInteger('91823918239182398123');
var b = new BigInteger('98237283728372873232');
var sum = a.add(b); // Addition
var difference = a.subtract(b); // Subtraction
var product = a.multiply(b); // Multiplication
var quotient = a.divide(b); // Division
var remainder = a.mod(b); // Modulus

RSA Encryption

This feature allows for RSA encryption and decryption, which is useful for secure data transmission.

var BigInteger = require('jsbn').BigInteger;
var RSAKey = require('jsbn').RSAKey;
var key = new RSAKey();
key.setPublic('...public exponent...', '...modulus...');
var encrypted = key.encrypt('text to encrypt');
key.setPrivate('...modulus...', '...public exponent...', '...private exponent...');
var decrypted = key.decrypt(encrypted);

Other packages similar to jsbn

Keywords

FAQs

Package last updated on 12 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc